#!/usr/bin/env python
# coding=utf-8

import RPi.GPIO as GPIO
import time

channel = 12

def init():
    GPIO.setwarnings(False)
    GPIO.setmode(GPIO.BOARD)
    GPIO.setup(channel, GPIO.IN)
    # GPIO.setup(channel, GPIO.IN, pull_up_down = GPIO.PUD_DOWN)
    pass

def detct():
    for i in range(1, 101):
        if GPIO.input(12) == True:
            print("Someone isclosing")
        elif GPIO.input(12) == False:
            print("Noanybody")
        time.sleep(3)

time.sleep(60)
init()
detct()
GPIO.cleanup()

